import request from '@/utils/request'


// 获取审核列表
export function reqAuditPlanListList(query) {
  return request({
    url: '/manager/plan/planCheckIndex',
    method: 'get',
    params: query
  })
}
// 根据id获取广告组信息
export function reqAdGroupByPlanId(id) {
  return request({
    url: '/manager/plan/planGroupInfo?id=' + id,
    method: 'get'
  })
}

// 根据id获取广告计划信息
export function reqPlanInfoById(id) {
  return request({
    url: '/manager/plan/planInfo?id=' + id,
    method: 'get'
  })
}


// 根据id获取广告日志
export function reqPlanLogById(id) {
  return request({
    url: '/manager/plan/planLog?order_id=' + id,
    method: 'get'
  })
}

// 获取所有平台
export function reqPlateList() {
  return request({
    url: '/manager/api/getPlateList',
    method: 'get'
  })
}
// 获取广告组类型
export function reqAdTypeList(query) {
  return request({
    url: '/custom/api/getGroupType',
    method: 'get',
    params: query
  })
}
//根据平台id搜索活动
export function reqGetTaskList(query) {
  return request({
    url: '/manager/plan/getTaskList',
    method: 'get',
    params: query
  })
}

//审核通过
export function reqPlanCheckPass(query) {
  return request({
    url: '/manager/plan/planCheckPass',
    method: 'post',
    data: query
  })
}
//审核驳回
export function reqPlanCheckNotPass(query) {
  return request({
    url: '/manager/plan/planCheckNotPass',
    method: 'post',
    data: query
  })
}
//投放中广告列表
export function reqPlanWorkIndex(query) {
  return request({
    url: '/manager/plan/planWorkIndex',
    method: 'get',
    params: query
  })
}

// 暂停计划
export function reqPlanStatusClose(id) {
  return request({
    url: '/manager/plan/setPlanStausClose?id=' + id,
    method: 'get'
  })
}

// 开启计划
export function reqPlanStatusOpen(id) {
  return request({
    url: '/manager/plan/setPlanStausOpen?id=' + id,
    method: 'get'
  })
}



//编辑已投放
export function reqPositionTaskList(id) {
  return request({
    url: '/manager/plan/getPositionTaskList?id='+id,
    method: 'get',
  })
}

//保存编辑
export function savePositionTaskList(query) {
  return request({
    url: '/manager/plan/positionTaskList',
    method: 'post',
    data: query
  })
}



// 暂停计划
export function reqPositionStausClose(id) {
  return request({
    url: '/manager/plan/setPositionStausClose?id=' + id,
    method: 'get'
  })
}

// 开启计划
export function reqPositionStausOpen(id) {
  return request({
    url: '/manager/plan/setPositionStausOpen?id=' + id,
    method: 'get'
  })
}
//排期
export function reqSchedulList() {
  return request({
    url: '/manager/plan/schedulList',
    method: 'get'
  })
}
//获取投放状态
export function reqGetPlanVersionStatus() {
  return request({
    url: '/manager/api/getPlanVersionStatus',
    method: 'get'
  })
}


//获取投放状态
export function reqGgetPlanPosition() {
  return request({
    url: '/manager/api/getPlanPosition',
    method: 'get'
  })
}
//获取查看页面的实时数据
export function reqGetTimeData(id) {
  return request({
    url: '/manager/plan/getTimeData?id='+id,
    method: 'get'
  })
}
//
export function reqPlanTaskIndex(data) {
  return request({
    url: '/manager/plan/planTaskIndex',
    method: 'get',
    params:data,
  })
}
//已投放列表导出
export function reqPlanWorkIndexExport(data) {
  return request({
    url: '/manager/plan/planWorkIndexExport',
    method: 'post',
    data: data,
  })
}

//待审核列表导出
export function reqPlanCheckIndexExport(data) {
  return request({
    url: '/manager/plan/planCheckIndexExport',
    method: 'post',
    data: data,
  })
}
